package com.empty.oredermenu.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
import com.empty.oredermenu.R
import com.empty.oredermenu.javabeen.FindMenuListBeen

/**
 * Created by empty cup on 2017/7/10.
 */
class FindListAdapter(val content: Context,var findMenuBeens : ArrayList<FindMenuListBeen>) :BaseAdapter(){



    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
        var convert = convertView
        var viewHolder : ViewHolder
        if (convert == null){
            convert = LayoutInflater.from(content).inflate(R.layout.activity_find,null)
            viewHolder = ViewHolder()
            viewHolder.textfind = convert.findViewById(R.id.textfind) as TextView?
            convert.setTag(viewHolder)
        }else{
            viewHolder = convert.getTag() as ViewHolder
        }
        viewHolder.textfind!!.text = findMenuBeens.get(position).title

        return convert!!
    }

    override fun getItem(position: Int): Any {
        return null!!
    }

    override fun getItemId(position: Int): Long {
        return 0
    }

    override fun getCount(): Int {
        return findMenuBeens.size
    }

    class ViewHolder{
        var textfind: TextView? = null
    }


}